<include file="Common/header" />
<!-- 导航栏 -->
{$bread_crumb}
<!-- 导航栏 -->
<div class="page-container">
    <form action="{:U(CONTROLLER_NAME.'/update')}" method="post" class="form form-horizontal" enctype="multipart/form-data" onsubmit="return submit_before()">

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>分类：</label>
            <div class="formControls col-xs-8 col-sm-9" style="width:20%">
                <select name="category_id">
                    <option value="0">无</option>
                    <volist name="category" id="vo">
                        <option value="{$vo['id']}" <if condition="($vo['id'] eq $data['category_id'])">selected=selected</if> >{$vo['name']}</option>
                    </volist>
                </select>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="标题" name="title" id="title"  value="{$data.title}">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>内容：</label>
            

            <input type="hidden" name="content" id="content" value="{$data.content}">
            <div class="formControls col-xs-8 col-sm-9">
                <script id="editor" type="text/plain" style="width:100%;height:400px;"></script> 
            </div>

        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">描述：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea cols="" rows="" class="textarea"  placeholder="给点描述信息吧..." name="description">{$data.description}</textarea>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>位置：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" placeholder="" id="" name="position"  value="{$data.position}">
            </div>
        </div>
        <if condition="$data['image']">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">原图片：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <img width="300" class="thumbnail" src="{$data['image']}">
                </div>
            </div>
        </if>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">新分类图片：</label>
            <div class="formControls col-xs-8 col-sm-9"> <span class="btn-upload form-group">
                <input class="input-text upload-url" type="text" name="uploadfile" readonly>
                <a href="javascript:void();" class="btn btn-primary radius upload-btn"><i class="Hui-iconfont">&#xe642;</i> 浏览</a>
                <input type="file" multiple name="image" class="input-file">
                </span>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
                <button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>

                <input type="hidden" name="id" value="{$data.id}">

            </div>
        </div>
    </form>
</div>
<include file="Common/footer" />
<script type="text/javascript">
/*checkbox*/
$(function(){
    var ue = UE.getEditor('editor');
        $('.skin-minimal input').iCheck({
        checkboxClass: 'icheckbox-blue',
        radioClass: 'iradio-blue',
        increaseArea: '20%'
    });
    ue.addListener('ready', function (editor) {
        ue.setContent('{$data['content']|htmlspecialchars_decode}');
    });
});
/*表单提交之前的操作，主要针对一些数据类型*/
function submit_before() {
    $('#e_text').val(UE.getEditor('editor').getContent());
}


</script> 